<script>
export default {
  name: "AdminTreePlan",
  props: {
    detail: {
      type: Object,
      default: [],
    },
  },
  data() {
    return {
      notice: {
        title: "",
        content: "",
        noticeTime: "",
      },
      imageUrl:""
    };
  },
  methods: {
    submitForm() {
      this.$axios({
        method: "post",
        url: "http://localhost:8080/nav/admin/informone",
        data: this.$qs.stringify(this.notice),
      }).then((res) => {
        console.log(res.data);
        this.project1 = res.data;
        if (res.data.code == 1) {
          this.$router.go(-1);
        } else {
          console.log("error");
        }
      });
    },
    resetForm() {
      (this.notice.title = ""),
        (this.notice.content = ""),
        (this.notice.noticeTime = "");
    },
  },
};
</script>

<template>
  <el-form label-width="100px" v-model="notice" style="max-width: 460px">
    <el-form-item label="公告标题">
      <el-input v-model="notice.title" />
    </el-form-item>
    <el-form-item label="公告时间" prop="noticeTime">
      <el-input v-model="notice.noticeTime" type="date" autocomplete="off" />
    </el-form-item>
    <el-form-item label="公告内容">
      <el-input v-model="notice.content"  type="file" />
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="submitForm">提交</el-button>
      <el-button @click="resetForm()">清空</el-button>
    </el-form-item>
  </el-form>
</template>